home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 025a / crdepp.zip / TSTRUCT.C < prev    next >
Text File  |  1991-01-04  |  2KB  |  50 lines

  1. /* tstruct.c */
  2.  
  3. /***********************************************************************/
  4. /*                                                                     */
  5. /* Command-line program which will display the structure of a CRDE     */
  6. /* table.                                                              */
  7. /*                                          */
  8. /* Usage: tstruct <tablename>                                          */
  9. /*                                                                     */
  10. /* To compile this program requires the creation of a project file     */
  11. /* which should look something like                                    */
  12. /*                                                                     */
  13. /*   tstruct                                                           */
  14. /*   crde.lib                                                          */
  15. /*                                                                     */
  16. /***********************************************************************/
  17.  
  18. #include <stdio.h>
  19. #include <conio.h>
  20. #include "crde.h"
  21.  
  22.  
  23. int tbuffers = 128;
  24.  
  25. int main(int argc, char *argv[])
  26. {
  27.   TABLE *t;
  28.   int i;
  29.  
  30.   if (argc < 2) {
  31.     printf("usage: tstruct <tablename>\n");
  32.     exit(1);
  33.   }
  34.  
  35.   if ((t = topen(argv[1])) == NULL) {
  36.     printf("Unable to open table (error code = %d).\n", terrno);
  37.     exit(1);
  38.   }
  39.  
  40.   clrscr();
  41.   gotoxy(3, 2); printf("Viewing table %s.", argv[1]);
  42.   gotoxy(3, 3); printf("%ld rows found.", trows(t));
  43.   if (tview(tstruct(TEMP, t), NULL, NULL, 3, 4, 78, 23, 0x07, 0x07, 0x07,
  44.   NULL) < 0)
  45.     printf("Error %d occurred. Program aborted.", terrno);
  46.  
  47.   tclose(t);
  48. }
  49.  
  50. /* end of tstruct.c */